package com.operate.api.app.message.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.github.pagehelper.PageInfo;
import com.operate.api.app.info.domain.vo.AppBannerSearchVO;
import com.operate.api.app.info.domain.vo.AppBannerVO;
import com.operate.api.app.info.domain.vo.AppCompanySearchVO;
import com.operate.api.app.info.domain.vo.AppCompanyVO;
import com.operate.api.app.info.service.IAppCompanyService;
import com.operate.api.app.message.domain.vo.AppMessageSearchVO;
import com.operate.api.app.message.domain.vo.AppMessageVO;
import com.operate.api.app.message.service.IAppMessageService;
import com.operate.api.base.ApiIndex;
import com.operate.api.base.R;
import com.operate.api.base.RestPage;
import com.operate.api.operate.banner.service.IBannerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api( tags = ApiIndex.AppMessageController)
@RequestMapping(value = "/api/app/message")
@RestController
public class AppMessageController {

    @Autowired
    private IAppMessageService service;



    @ApiOperation(value = "查询信息列表[需要登录]")
    @GetMapping(value = "/list")
    @SaCheckLogin
    public R<RestPage<List<AppMessageVO>>> list(
            @ApiParam(value = "查询参数") @ModelAttribute AppMessageSearchVO searchVO) {
        List<AppMessageVO> list = service.getList(searchVO);
        RestPage restPage = new RestPage(new PageInfo(list), list);
        return new R(restPage);
    }



}